Convert To JSON
AutomatR.DefaultActivities.Datatable.ConvertToJSON
The "Convert To JSON" activity in AutomatR is part of the JSON activities package, designed to transform an object into a properly formatted JSON string representation. This activity is particularly useful for converting structured data, such as DataTables or custom objects, into a JSON format for further processing or storage.
Properties
Name | Description |
---|---|
Input | |
Data | Specifies the object data that will undergo conversion to JSON format. This can include DataTables, custom objects, or other structured data types. Object variables containing the data to be converted. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Convert To JSON" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
JSON | Outputs the result of the conversion, providing a JSON string representation of the input data. String variables to store the JSON-formatted data for further use in the workflow. |
How to use:
- Drag and drop the "Convert To JSON" activity onto the workflow.
- Configure the properties by specifying the object data to be converted to JSON.
- Optionally, configure the delay.
- Execute the workflow to transform the specified data into a JSON string.
Example: Consider an example where the "Convert To JSON" activity is used to convert a DataTable into a JSON string:
Convert To JSON:
Data: dataTable
JSON: jsonString
In this example, the activity converts the data within the "dataTable" variable into a JSON-formatted string, storing the result in the "jsonString" variable. Adjust the input properties as needed to accommodate various scenarios in your automation workflows.